<?php
/**
 * CreateTime: 2023/12/14 11:41
 * User:LinQ
 */

namespace App\Listeners;

use App\Events\ImportProgressUpdated;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Broadcast;

class ImportProgressListener implements ShouldQueue
{
    public function handle(ImportProgressUpdated $event)
    {
        $fileId = $event->fileId;
        echo $fileId;
        // 开启socket服务
        Artisan::call('swoole', ['action' => 'start']);
        echo "服务启动中";
    }
}
